<template>
	<view>
		<view class="text-center mt-200" v-if="inviteList.length === 0">暂无信息...</view>
		<view class="pl-30 pr-30 pt-30" v-for="(item, index) in inviteList" :key="index"
			@click="goUrl('/pages/job/forms?id='+item.id, item)">
			<view class="bg-white pl-20 pr-20 pt-30 pb-30 border-radius">
				<view class="flex space-between flex-align-end">
					<view class="font-bold font-30">{{item.name}}</view>
					<view class="font-26 font-g font-bold">{{item.payLow}}-{{item.payHigh}}</view>
				</view>
				<view class="flex font-26 mt-20">
					<view>{{item.companyId_dictText}}</view>
					<!-- <view class="ml-40">2000-5000人</view> -->
				</view>
				<view class="flex font-22 mt-10" style="color: #686E6E;">
					<view class="pt-10 pb-10 pl-30 pr-30">{{item.jobNature}}</view>
					<view class="pt-10 pb-10 pl-30 pr-30">{{item.peopleNum}}人</view>
					<view class="pt-10 pb-10 pl-30 pr-30">{{item.education_dictText}}</view>
					<view class="pt-10 pb-10 pl-30 pr-30">{{item.experience}}</view>
				</view>
				<view class="flex space-between items-center mt-10">
					<view class="flex items-center">
						<image src="../../static/images/avatar.png" mode=""
							style="width: 50rpx;height: 50rpx;border-radius: 50%;"></image>
						<view class="font-24 ml-10">{{item.hruserId_dictText}}</view>
					</view>
					<view class="font-24">{{item.city}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		list
	} from '../../api/invite';
	import {
		getInfo
	} from '../../api/hr_user.js';
	export default {
		data() {
			return {
				inviteList: [],
				pageNo: 1,
				pageSize: 10,
				hrId: ''
			};
		},
		onLoad() {
			this.getHr()
		},
		onReachBottom() {
			this.getInviteList()
		},
		methods: {
			goUrl(url, item) {
				uni.setStorageSync('info', item)
				this.$goRoute.goUrl(url)
			},
			getHr() {
				getInfo().then(res => {
					if (res.code === 200) {
						this.hrId = res.result.id
						this.getInviteList()
					} else {
						_this.$tips.showConfirmModal('您还未填写HR信息，请填写后管理职位', () => {
							uni.navigateBack()
						})
					}
				})
			},
			getInviteList() {
				uni.showLoading({
					title: '加载中'
				})
				list({
					pageSize: this.pageSize,
					pageNo: this.pageNo,
					hruserId: this.hrId
				}).then(res => {
					if (this.pageNo === 1) {
						this.inviteList = res.result.records
					} else {
						this.inviteList.push(...res.result.records)
					}
					this.pageNo += 1
					uni.hideLoading()
				})
			},
		}
	}
</script>

<style lang="less">
	page {
		background: #F6F6F6;
	}
</style>